Data processing device and data processing method

ABSTRACT

Embodiments of the present invention provide a data processing device and a data processing method. In the data processing device and the data processing method provided by the embodiments of the present invention, first data in a memory is written into a first non-volatile storage unit in a log file form, and a log file of the first data written into the first non-volatile storage unit is written into a second non-volatile storage unit. Because a data write speed of the first non-volatile storage unit is higher than a data write speed of the second non-volatile storage unit, fast backup of the data in the memory can be achieved, and when the data in the memory is lost in an abnormal situation, security of the data in the memory can be ensured.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.14/704,720, filed on May 5, 2015, which is a continuation of U.S. patentapplication Ser. No. 14/483,970, filed on Sep. 11, 2014, now U.S. Pat.No. 9,354,985. The U.S. patent application Ser. No. 14/483,970 is acontinuation of International Application No. PCT/CN2013/088324, filedon Dec. 2, 2013. All of the afore-mentioned patent applications arehereby incorporated by reference in their entireties.

TECHNICAL FIELD

The present invention relates to the field of information technologies,and in particular, to a data processing method and a data processingdevice.

BACKGROUND

With the continuous development of information technologies and thepopularization of mobile services, the quantity of clients significantlyincreases, which raises a higher requirement for a capability of aserver for responding to a client. Meanwhile, with the popularization ofbig data computing, a requirement for computing instantaneity is raised.A processing speed of a server processing these services directlyaffects a service processing speed and user satisfaction.

Improving a data read/write speed of a memory is one of factors thatimprove the service processing speed of the server. In addition, due toa feature that data in the memory is easily lost, the data in the memoryis lost upon an abnormal power failure or restart. Generally, anon-volatile storage medium is used to back up the data in the memory toensure security of the data in the memory. When the data in the memoryis lost, the data lost from the memory can be recovered.

The non-volatile storage medium can permanently save the data, and thedata is still not lost even in the case of a power failure. A dataaccess speed of a large-capacity non-volatile storage medium is slow,but the data access speed of the memory is fast. If a scenario in whichthe data is lost from the memory occurs during a process of writing datain the memory into the non-volatile storage medium for backup, the datathat is not backed up in a timely manner cannot be recovered. As aresult, the security of the data in the memory cannot be ensured.

SUMMARY

Embodiments of the present invention provide a data processing deviceand a data processing method, to solve a problem that data backup failsdue to a low data backup speed when data is written into a memory in anabnormal situation, resulting in a fact that security of the data in thememory is not high.

An embodiment of the present invention provides a data processingdevice, where the data processing device includes a control unit, amemory, a first non-volatile storage unit, and a second non-volatilestorage unit; a data write speed of the first non-volatile storage unitis higher than a data write speed of the second non-volatile storageunit; and

-   -   the control unit is configured to write first data into the        memory, write the first data into the first non-volatile storage        unit in a log file form, and write, into the second non-volatile        storage unit, a log file of the first data written into the        first non-volatile storage unit.

Optionally, the control unit includes a memory read/write control unitand a persistency control unit, where

-   -   the memory read/write control unit is configured to write the        first data into the memory, and write the first data into the        first non-volatile storage unit in the log file form; and    -   the persistency control unit is configured to write, into the        second non-volatile storage unit, the log file of the first data        written into the first non-volatile storage unit.

The memory read/write control unit is further configured to write seconddata into the memory, and write the second data into the firstnon-volatile storage unit in the log file form.

Optionally, the persistency control unit is further configured toacquire the first data from the memory and write the first data into thesecond non-volatile storage unit.

Optionally, the control unit further includes a data scrubbing unit,where

-   -   the data scrubbing unit is configured to convert the log file of        the first data in the second non-volatile storage unit to the        first data.

Optionally, the control unit further includes a data recovery unit,where

-   -   the data recovery unit is configured to recover the first data        lost from the memory by using the first data in the second        non-volatile storage unit.

Optionally, the data recovery unit is further configured to recover thefirst data lost from the memory by using the log file of the first datain the second non-volatile storage unit, and recover the second datalost from the memory by using a log file of the second data in the firstnon-volatile storage unit.

Optionally, the data recovery unit is further configured to recover thefirst data lost from the memory by using the first data in the secondnon-volatile storage unit, and recover the second data lost from thememory by using a log file of the second data in the first non-volatilestorage unit.

Optionally, the data recovery unit is further configured to recover thefirst data lost from the memory by using the first data and the log fileof the first data in the second non-volatile storage unit, and recoverthe second data lost from the memory by using a log file of the seconddata in the first non-volatile storage unit.

Optionally, the persistency control unit is further configured to: afterthe log file of the first data in the first non-volatile storage unit iswritten into the second non-volatile storage unit, instruct the firstnon-volatile storage unit to release space occupied by the log file ofthe first data.

Optionally, the persistency control unit is further configured to: whenthe memory read/write control unit writes the second data into the firstnon-volatile storage unit, suspend writing the log file of the firstdata in the first non-volatile storage unit into the second non-volatilestorage unit.

Optionally, the data write speed of the first non-volatile storage unitis the same as a data write speed of the memory.

An embodiment of the present invention further provides a dataprocessing device, where the data processing device includes a controlunit, a memory, a first non-volatile storage unit, and a secondnon-volatile storage unit; a data write speed of the first non-volatilestorage unit is higher than a data write speed of the secondnon-volatile storage unit; and

-   -   the control unit is configured to write first data into the        memory, and write the first data into the first non-volatile        storage unit in a log file form; and    -   the control unit is further configured to acquire the first data        from the memory, and convert the acquired first data to a log        file and write the converted log file into the second        non-volatile storage unit.

Optionally, the control unit includes a memory read/write control unitand a persistency control unit, where

-   -   the memory read/write control unit is configured to write the        first data into the memory, and write the first data into the        first non-volatile storage unit in the log file form; and    -   the persistency control unit is configured to acquire the first        data from the memory, and convert the acquired first data to a        log file and write the converted log file into the second        non-volatile storage unit.

Optionally, the memory read/write control unit is further configured towrite second data into the memory, and write the second data into thefirst non-volatile storage unit in the log file form.

Optionally, the persistency control unit is further configured toacquire the first data from the memory and write the first data into thesecond non-volatile storage unit.

Optionally, the control unit further includes a data scrubbing unit,where

-   -   the data scrubbing unit is configured to convert the log file of        the first data in the second non-volatile storage unit to the        first data.

Optionally, the control unit further includes a data recovery unit,where

-   -   the data recovery unit is configured to recover the first data        lost from the memory by using the first data in the second        non-volatile storage unit.

Optionally, the data recovery unit is further configured to recover thefirst data lost from the memory by using the log file of the first datain the second non-volatile storage unit, and recover the second datalost from the memory by using a log file of the second data in the firstnon-volatile storage unit.

Optionally, the data recovery unit is further configured to recover thefirst data lost from the memory by using the first data in the secondnon-volatile storage unit, and recover the second data lost from thememory by using a log file of the second data in the first non-volatilestorage unit.

Optionally, the data recovery unit is further configured to recover thefirst data lost from the memory by using the first data and the log fileof the first data in the second non-volatile storage unit, and recoverthe second data lost from the memory by using a log file of the seconddata in the first non-volatile storage unit.

Optionally, the data write speed of the first non-volatile storage unitis the same as a data write speed of the memory.

An embodiment of the present invention further provides a dataprocessing device, where the data processing device includes a controlunit, a memory, a first non-volatile storage unit, and a secondnon-volatile storage unit; a data write speed of the first non-volatilestorage unit is higher than a data write speed of the secondnon-volatile storage unit; and

-   -   the control unit is configured to write first data into the        memory, write the first data into the first non-volatile storage        unit in a log file form, and write, into the second non-volatile        storage unit, the first data in the memory.

Optionally, the control unit includes a memory read/write control unitand a persistency control unit, where

-   -   the memory read/write control unit is configured to write the        first data into the memory, and write the first data into the        first non-volatile storage unit in the log file form; and    -   the persistency control unit is configured to write, into the        second non-volatile storage unit, the first data in the memory.

Optionally, the memory read/write control unit is further configured towrite second data into the memory, and write the second data into thefirst non-volatile storage unit in the log file form.

Optionally, the control unit further includes a data recovery unit,where

-   -   the data recovery unit is configured to recover the first data        lost from the memory by using the first data in the second        non-volatile storage unit.

An embodiment of the present invention provides a data processingmethod, where the data processing method is applied in a data processingdevice and the data processing method includes:

-   -   receiving first data to be written into a memory of the data        processing device;    -   writing the first data into the memory, and writing the first        data into a first non-volatile storage unit in a log file form;        and    -   writing, into a second non-volatile storage unit, a log file of        the first data written into the first non-volatile storage unit,        where a data write speed of the first non-volatile storage unit        is higher than a data write speed of the second non-volatile        storage unit.

Optionally, the method further includes:

-   -   writing second data into the memory, and writing the second data        into the first non-volatile storage unit in the log file form.

Optionally, the method further includes: acquiring the first data fromthe memory and writing the first data into the second non-volatilestorage unit.

Optionally, the method further includes: converting the log file of thefirst data in the second non-volatile storage unit to the first data.

Optionally, when the first data in the memory is lost, recovering thefirst data by using the first data in the second non-volatile storageunit.

Optionally, when the first data in the memory is lost, recovering thefirst data lost from the memory by using the log file of the first datain the second non-volatile storage unit; and

-   -   when the second data in the memory is lost, recovering the        second data lost from the memory by using a log file of the        second data in the first non-volatile storage unit.

Optionally, when the first data in the memory is lost, recovering thefirst data lost from the memory by using the first data in the secondnon-volatile storage unit; and

-   -   when the second data in the memory is lost, recovering the        second data lost from the memory by using a log file of the        second data in the first non-volatile storage unit.

Optionally, the recovering the first data lost from the memory by usingthe first data in the second non-volatile storage unit includes:

-   -   determining whether a conversion from the log file of the first        data to the first data is completed;    -   when the conversion is not completed, recovering the first data        in the memory by using converted first data and the log file of        the first data that is not converted; and    -   when the conversion is completed, recovering the first data in        the memory by using converted first data.

Optionally, after the log file of the first data in the firstnon-volatile storage unit is written into the second non-volatilestorage unit, instructing the first non-volatile storage unit to releasespace occupied by the log file of the first data.

Optionally, after the writing, into a second non-volatile storage unit,a log file of the first data in the first non-volatile storage unit,suspending writing the log file of the first data in the firstnon-volatile storage unit into the second non-volatile storage unit.

Optionally, the data write speed of the first non-volatile storage unitis the same as a data write speed of the memory.

An embodiment of the present invention further provides another dataprocessing method, where the data processing method is applied in a dataprocessing device and the data processing method includes:

-   -   receiving first data to be written into a memory of the data        processing device;    -   writing the first data into the memory, and writing the first        data into a first non-volatile storage unit in a log file form;        and    -   writing, into a second non-volatile storage unit, the first data        written into the memory, where a data write speed of the first        non-volatile storage unit is higher than a data write speed of        the second non-volatile storage unit.

Optionally, the method further includes:

-   -   writing second data into the memory, and writing the second data        into the first non-volatile storage unit in the log file form.

Optionally, the writing, into a second non-volatile storage unit, thefirst data written into the memory includes:

-   -   writing, into the second non-volatile storage unit, the first        data written into the memory; or    -   after the first data written into the memory is converted to a        log file, writing the converted log file into the second        non-volatile storage unit.

Optionally, the method further includes:

-   -   after the first data written into the memory is converted to the        log file and the converted log file is written into the second        non-volatile storage unit, converting the log file of the first        data in the second non-volatile storage unit to the first data.

Optionally, when the first data in the memory is lost, if the first datais stored in the second non-volatile storage unit, recovering the firstdata by using the first data in the second non-volatile storage unit; ifonly the log file of the first data is stored in the second non-volatilestorage unit, recovering the first data lost from the memory by usingthe log file of the first data; and if the first data in the memory islost during a process of converting the log file of the first data inthe second non-volatile storage unit to the first data, recovering thefirst data in the memory by using converted first data and the log fileof the first data that is not converted.

Optionally, when the second data in the memory is lost, recovering thesecond data lost from the memory by using a log file of the second datain the first non-volatile storage unit.

Optionally, the recovering the first data lost from the memory by usingthe first data in the second non-volatile storage unit includes:

-   -   determining whether a conversion from the log file of the first        data to the first data is completed;    -   when the conversion is not completed, recovering the first data        in the memory by using converted first data and the log file of        the first data that is not converted; and    -   when the conversion is completed, recovering the first data in        the memory by using converted first data.

Optionally, the data write speed of the first non-volatile storage unitis the same as a data write speed of the memory.

An embodiment of the present invention further provides a dataprocessing method, where the data processing method is applied in a dataprocessing device and the data processing method includes:

-   -   receiving first data to be written into a memory of the data        processing device;    -   writing the first data into the memory, and writing the first        data into a first non-volatile storage unit in a log file form;        and    -   converting the first data in the memory to a log file, and        writing the converted log file into a second non-volatile        storage unit, where a data write speed of the first non-volatile        storage unit is higher than a data write speed of the second        non-volatile storage unit.

Optionally, the method further includes:

-   -   writing second data into the memory, and writing the second data        into the first non-volatile storage unit in the log file form.

Optionally, the method further includes:

-   -   writing the first data in the memory into the second        non-volatile storage unit.

Optionally, the method further includes:

-   -   converting the log file of the first data in the second        non-volatile storage unit to the first data.

Optionally, when the first data in the memory is lost, recovering thefirst data lost from the memory by using the first data in the secondnon-volatile storage unit.

Optionally, when the first data in the memory is lost, recovering thefirst data lost from the memory by using the log file of the first datain the second non-volatile storage unit; and

-   -   when the second data in the memory is lost, recovering the        second data lost from the memory by using a log file of the        second data in the first non-volatile storage unit.

Optionally, when the first data in the memory is lost, recovering thefirst data lost from the memory by using the first data in the secondnon-volatile storage unit; and

-   -   when the second data in the memory is lost, recovering the        second data lost from the memory by using a log file of the        second data in the first non-volatile storage unit.

Optionally, the recovering the first data lost from the memory by usingthe first data in the second non-volatile storage unit includes:

-   -   determining whether a conversion from the log file of the first        data to the first data is completed;    -   when the conversion is not completed, recovering the first data        in the memory by using converted first data and the log file of        the first data that is not converted; and    -   when the conversion is completed, recovering the first data in        the memory by using converted first data.

Optionally, the data write speed of the first non-volatile storage unitis the same as a data write speed of the memory.

An embodiment of the present invention further provides a dataprocessing method, where the data processing method is applied in a dataprocessing device and the data processing method includes:

-   -   receiving first data to be written into a memory of the data        processing device;    -   writing the first data into the memory, and writing the first        data into a first non-volatile storage unit in a log file form;        and    -   writing the first data in the memory into a second non-volatile        storage unit, where a data write speed of the first non-volatile        storage unit is higher than a data write speed of the second        non-volatile storage unit.

Optionally,

-   -   writing second data into the memory, and writing the second data        into the first non-volatile storage unit in the log file form.

Optionally, when the first data in the memory is lost, recovering thefirst data by using the first data in the second non-volatile storageunit.

Optionally, the data write speed of the first non-volatile storage unitis the same as a data write speed of the memory.

In the data processing device and the data processing method provided bythe embodiments of the present invention, the first data written intothe memory is written into the first non-volatile storage unit in thelog file form, and the log file of the first data written into the firstnon-volatile storage unit is written into the second non-volatilestorage unit. Because the data write speed of the first non-volatilestorage unit is higher than the data write speed of the secondnon-volatile storage unit, fast backup of the data in the memory can beachieved, and when the data in the memory is lost in an abnormalsituation, security of the data in the memory can be ensured.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentinvention more clearly, the following briefly introduces theaccompanying drawings required for describing the embodiments.Apparently, the accompanying drawings in the following description showmerely some embodiments of the present invention, and a person ofordinary skill in the art may still derive other drawings from theseaccompanying drawings without creative efforts.

FIG. 1 is a schematic structural diagram of a data processing deviceaccording to an embodiment of the present invention;

FIG. 2 is a schematic diagram of a specific implementation manner of adata processing device according to an embodiment of the presentinvention;

FIG. 3 is a schematic flowchart of a data processing method according toan embodiment of the present invention;

FIG. 4 is a schematic flowchart of a specific implementation of a dataprocessing method according to an embodiment of the present invention;

FIG. 5 is a schematic structural diagram of a specific application of adata processing device in a server according to an embodiment of thepresent invention;

FIG. 6 is a schematic flowchart of a data read/write process performedby a memory read/write control unit and a memory in FIG. 5;

FIG. 7 is a schematic diagram of a specific implementation manner forwriting service data into a memory and a first non-volatile storage unitin FIG. 5;

FIG. 8-a is a schematic flowchart of acquiring a log file of first datafrom a first non-volatile storage unit and performing data persistencyin FIG. 5;

FIG. 8-b is a schematic flowchart of acquiring a log file of first datafrom a memory and performing data persistency in FIG. 5;

FIG. 9 is a schematic flowchart of writing service data in a memory intoa data area of a second non-volatile storage unit by a data scrubbingunit in FIG. 5;

FIG. 10 is a schematic flowchart of a data recovery process performed bya data recovery unit in FIG. 5;

FIG. 11 is a schematic flowchart of another data processing methodaccording to an embodiment of the present invention;

FIG. 12 is schematic flowchart of a further implementation of the methoddescribed in FIG. 11; and

FIG. 13 is a schematic flowchart of another data processing methodaccording to an embodiment of the present invention.

DESCRIPTION OF EMBODIMENTS

The following clearly and describes the technical solutions in theembodiments of the present invention with reference to the accompanyingdrawings in the embodiments of the present invention. Apparently, thedescribed embodiments are a part rather than all of the embodiments ofthe present invention. All other embodiments obtained by a person ofordinary skill in the art based on the embodiments of the presentinvention without creative efforts shall fall within the protectionscope of the present invention.

Refer to FIG. 1, which is a schematic structural diagram of a dataprocessing device 100 according to an embodiment of the presentinvention. The data processing device 100 includes a memory 101, acontrol unit 102, a first non-volatile storage unit 103, and a secondnon-volatile storage unit 104; a data write speed of the firstnon-volatile storage unit 103 is higher than a data write speed of thesecond non-volatile storage unit 104; and

-   -   the control unit 102 is configured to write first data into the        memory 101, write the first data into the first non-volatile        storage unit 103 in a log file form, and write, into the second        non-volatile storage unit 104, a log file of the first data        written into the first non-volatile storage unit 103.

In the foregoing data processing device 100, the control unit 102writes, into the first non-volatile storage unit 103 in the log fileform, the first data written into the memory 101, and writes, into thesecond non-volatile storage unit 104, the log file of the first datawritten into the first non-volatile storage unit 103. Because the datawrite speed of the first non-volatile storage unit 103 is higher thanthe data write speed of the second non-volatile storage unit 104, fastbackup of service data can be achieved, and especially for service datain the memory that needs to be stored by a storage processing device,the security of the memory data can be ensured. Meanwhile, the firstdata is stored in the log file form, and the log file has metadata andcan record only changed data and can implement data recovery; thereforewhen a capacity of the first non-volatile storage unit 103 is smallerthan a capacity of the memory 101, fast data backup can be achieved anddata lost from the memory can be recovered when the data in the memoryis lost.

As another optional implementation manner, the control unit 102 isfurther configured to write the first data into the memory 101, writethe first data into the first non-volatile storage unit 103 in the logfile form, and write, into the second non-volatile storage unit 104, thefirst data written into the memory. The first data is converted to thelog file, the converted log file is written into the first non-volatilestorage unit 103, and the first data written into the memory is writteninto the second non-volatile storage unit 104, so that separation ofread and write of the first non-volatile storage unit 103 can beachieved, thereby avoiding that the first non-volatile storage unit 103simultaneously processes a data read request of the second non-volatilestorage unit 104 while writing data, and further improving log filewriting efficiency of the first non-volatile storage unit 103.

As an optional implementation manner, the data write speed of the firstnon-volatile storage unit 103 is the same as or close to a data writespeed of the memory. In this way, it can be ensured that the datawritten into the memory 101 is synchronized to the first non-volatilestorage unit 103. When data is lost from the memory 101 due to anabnormality, the log file in the first non-volatile storage unit 103 canbe used to recover lost data.

Refer to FIG. 2, which is a schematic diagram of a specificimplementation manner of a data processing device 100 according to anembodiment of the present invention. As shown in FIG. 2, the controlunit 100 may include a memory read/write control unit 105 and apersistency control unit 106, where

-   -   the memory read/write control unit 105 is configured to write        the first data into the memory 101, and write the first data        into the first non-volatile storage unit 103 in the log file        form; and    -   the persistency control unit 106 is configured to write, into        the second non-volatile storage unit 104, the log file of the        first data written into the first non-volatile storage unit 103.

As another implementation manner, the memory read/write control unit 105is configured to write the first data into the memory 101, and write thefirst data into the first non-volatile storage unit 103 in the log fileform; and

-   -   the persistency control unit 106 is configured to write, into        the second non-volatile storage unit 104, the first data in the        memory. The persistency control unit 106 is further configured        to convert the first data in the memory 101 to the log file and        write the converted log file into the second non-volatile        storage unit 104.

Optionally, the memory read/write control unit 105 is further configuredto write second data into the memory 101, and write the second data intothe first non-volatile storage unit 103 in the log file form.

The second data is stored in the first non-volatile storage unit 103 inthe log file form. When the data in the memory 101 is lost, lost datacan be recovered by using the data in the first non-volatile storageunit 103. Especially, the second data may be the changed data among thedata in the memory. Because the log file includes the metadata and canimplement data recovery according to the metadata and the changed data,when storage space of the first non-volatile storage unit 103 is smallerthan space of the memory 101, data recovery can be achieved when data islost from the memory due to an abnormality.

Optionally, the data control unit further includes a data scrubbing unit107, configured to convert the log file of the first data in the secondnon-volatile storage unit 104 to the first data.

Accordingly, the control unit 102 further includes a data recovery unit108, configured to recover the first data lost from the memory by usingthe first data in the second non-volatile storage unit 104.

As another optional implementation manner, the persistency control unit106 is further configured to acquire the first data from the memory 101and write the first data into the second non-volatile storage unit 104.In this way, the second non-volatile storage unit 104 does not need toconvert the log file of the first data to the first data, therebyfurther improving the data processing efficiency of the data processingdevice.

When the data in the memory 101 is lost before the second non-volatilestorage unit 104 starts to convert the log file of the first data to thefirst data, the data recovery unit 108 recovers the first data lost fromthe memory 101 by using the log file of the first data in the secondnon-volatile storage unit 104, and recovers the second data lost fromthe memory 101 by using the log file of the second data in the firstnon-volatile storage unit 103.

If the data in the memory 101 is lost after the second non-volatilestorage unit 104 has completed a conversion of the log file of the firstdata to the first data, the data recovery unit 108 recovers the firstdata lost from the memory 101 by using the first data in the secondnon-volatile storage unit 104, and recovers the second data lost fromthe memory by using the log file of the second data in the firstnon-volatile storage unit 103.

If the data in the memory 101 is lost when the second non-volatilestorage unit 104 has not completed the conversion of the log file of thefirst data to the first data, the data recovery unit 108 is furtherconfigured to recover the first data lost from the memory by using thefirst data and the log file of the first data in the second non-volatilestorage unit, and recover the second data lost from the memory by usingthe log file of the second data in the first non-volatile storage unit103. That is, the data recovery unit 108 recovers the first data in thememory 101 by using the first data part that has been converted and thelog file part of the first data that is not converted.

The data recovery unit 108 recovers the data lost from the memory 101,so that the memory 101 achieves fast data read and write. When the datain the memory 101 is lost, the lost data can be recovered in a timelymanner, thereby ensuring service data security.

As an optional implementation manner, the persistency control unit 106is further configured to: after the log file of the first data in thefirst non-volatile storage unit 103 is written into the secondnon-volatile storage unit 104, instruct the first non-volatile storageunit 103 to release space occupied by the log file of the first data. Inthis way, the first non-volatile storage unit 103 can circularly storethe data that is written into the memory 101, thereby improving usage ofthe first non-volatile storage unit 103.

As an optional implementation manner, the persistency control unit 106is further configured to: when the memory read/write control unit 105writes the second data into the first non-volatile storage unit 103,suspend writing the log file of the first data in the first non-volatilestorage unit 103 into the second non-volatile storage unit 104. In thisway, the first non-volatile storage unit 103 can achieve pure continuouswriting. Relative to a case in which data is read from the firstnon-volatile storage unit while data is written into the firstnon-volatile storage unit 103, the data write speed of the firstnon-volatile storage unit 103 is improved.

The memory in the foregoing data processing device may be a dynamicrandom access memory DRAM, and the first non-volatile storage unit maybe an NVM (Non-Volatile Memory, non-volatile memory). The embodiment ofthe present invention does not limit the specific implementation manner.

Refer to FIG. 3, which is a schematic flowchart of a data processingmethod according to an embodiment of the present invention, where thedata processing method is applied in a data processing device andincludes:

Step 300: Receive first data to be written into a memory of the dataprocessing device.

Step 302: Write the first data into the memory, and write the first datainto a first non-volatile storage unit in a log file form.

Step 304: Write, into a second non-volatile storage unit, a log file ofthe first data written into the first non-volatile storage unit, where adata write speed of the first non-volatile storage unit is higher than adata write speed of the second non-volatile storage unit.

The first data written into the memory is written into the firstnon-volatile storage unit in the log file form, and the log file of thefirst data written into the first non-volatile storage unit is writteninto the second non-volatile storage unit. Because the data write speedof the first non-volatile storage unit is higher than the data writespeed of the second non-volatile storage unit, fast backup of servicedata can be achieved, and especially for service data in the memory thatneeds to be stored by a storage processing device, the security of thememory data can be ensured. Meanwhile, the first data is stored in thelog file form, and the log file has metadata and can record only changeddata and can implement data recovery; therefore when a capacity of thefirst non-volatile storage unit is smaller than a capacity of thememory, fast data backup can be achieved and data lost from the memorycan be recovered when the data in the memory is lost.

Optionally, the data write speed of the first non-volatile storage unitis the same as or close to a data write speed of the memory. In thisway, it can be ensured that the data written into the memory issynchronized to the first non-volatile storage unit. When data is lostfrom the memory due to an abnormality, the log file in the firstnon-volatile storage unit can be used to recover lost data.

Refer to in FIG. 4, which is a schematic diagram of a specificimplementation of a data processing method according to an embodiment ofthe present invention. As shown in FIG. 4, the data processing methodaccording to the embodiment of the present invention further includes:

Step 306: Write second data into the memory, and write the second datainto the first non-volatile storage unit in the log file form.

The data is stored in the first non-volatile storage unit in the logfile form. When the data in the memory is lost, lost data can berecovered by using the data in the first non-volatile storage unit.Especially, the second data may be changed data among the data in thememory. Because the log file includes the metadata and can implementdata recovery according to the metadata and the changed data, whenstorage space of the first non-volatile storage unit is smaller thanspace of the memory, data recovery can be achieved when data in thememory is lost due to an abnormality.

The method may further include:

Step 308: Convert the log file of the first data in the secondnon-volatile storage unit to the first data; optionally, after step 306,the method may further include: acquiring the first data from the memoryand writing the first data into the second non-volatile storage unit. Inthis way, step 308 does not need to be performed, thereby furtherimproving the data back efficiency.

Step 310: When the first data in the memory is lost, recover the firstdata by using the first data in the second non-volatile storage unit.Specifically, the method may include: when the first data in the memoryis lost, if the first data is stored in the second non-volatile storageunit, recovering the first data by using the first data in the secondnon-volatile storage unit; if only the log file of the first data isstored in the second non-volatile storage unit, recovering the firstdata lost from the memory by using the log file of the first data; andif the first data in the memory is lost during a process of convertingthe log file of the first data in the second non-volatile storage unitto the first data, recovering the first data in the memory by usingconverted first data and the log file of the first data that is notconverted.

Optionally, when the second data in the memory is lost, the second datalost from the memory is recovered by using a log file of the second datain the first non-volatile storage unit.

Optionally, the recovering the first data lost from the memory by usingthe first data in the second non-volatile storage unit includes:determining whether a conversion from the log file of the first data tothe first data is completed; when the conversion is not completed,recovering the first data in the memory by using converted first dataand the log file of the first data that is not converted; and when theconversion is completed, recovering the first data in the memory byusing converted first data.

Fast data read/write of the memory is achieved by using the foregoingmanner of recovering the data lost from the memory. When the data in thememory is lost, the lost data can be recovered in a timely manner,thereby ensuring service data security.

As another aspect of the embodiment of the present invention, theforegoing method may further include: after the log file of the firstdata in the first non-volatile storage unit is written into the secondnon-volatile storage unit, instructing the first non-volatile storageunit to release space occupied by the log file of the first data. Inthis way, the first non-volatile storage unit can circularly store thedata written into the memory, thereby improving usage of the firstnon-volatile storage unit.

As another aspect of the embodiment of the present invention, the methodmay further include: when the second data is written into the firstnon-volatile storage unit in the log file form, suspending writing thelog file of the first data in the first non-volatile storage unit intothe second non-volatile storage unit. In this way, the firstnon-volatile storage unit can achieve pure continuous writing. Relativeto a case in which data is read from the first non-volatile storage unitwhile data is written into the first non-volatile storage unit, the datawrite speed of the first non-volatile storage unit is improved.

In the foregoing steps: the memory may be a dynamic random access memoryDRAM (Dynamic Random Access Memory, dynamic random access memory), andthe first non-volatile storage unit may be an NVM. The embodiment of thepresent invention does not limit the specific implementation manner.

Refer to FIG. 11, which is a schematic flowchart of another dataprocessing method according to an embodiment of the present invention,where the data processing method is applied in a data processing deviceand includes:

Step 1100: Receive first data to be written into a memory of the dataprocessing device.

Step 1102: Write the first data into the memory, and write the firstdata into a first non-volatile storage unit in a log file form.

Step 1104: Convert the first data in the memory to a log file, and writethe converted log file into a second non-volatile storage unit, where adata write speed of the first non-volatile storage unit is higher than adata write speed of the second non-volatile storage unit.

The first data written into memory is written into the firstnon-volatile storage unit in the log file form, and the first data inthe memory is converted to the log file and the converted log file iswritten into the second non-volatile storage unit. Because the datawrite speed of the first non-volatile storage unit is higher than thedata write speed of the second non-volatile storage unit, fast backup ofservice data can be achieved, and especially for service data in thememory that needs to be stored by a storage processing device, thesecurity of the memory data can be ensured. Meanwhile, the first data isstored in the log file form, and the log file has metadata and canrecord only changed data and can implement data recovery; therefore whena capacity of the first non-volatile storage unit is smaller than acapacity of the memory, fast data backup can be achieved and data lostfrom the memory can be recovered when the data in the memory is lost.

Refer to FIG. 12, which is a schematic flowchart of a furtherimplementation of the method shown in FIG. 11. The method furtherincludes:

Step 1106: Write second data into the memory, and write the second datainto the first non-volatile storage unit in the log file form.

Step 1108:

Convert the log file of the first data in the second non-volatilestorage unit to the first data.

The log file of the first data in the second non-volatile storage unitis converted to the first data, so that the first data in the memory canbe recovered by using the first data in the second non-volatile storageunit when the first data in the memory is lost.

As an optional implementation manner, the first data in the memory mayfurther be written into the second non-volatile storage unit. In thisway, a step of converting the log file of the first data in the secondnon-volatile storage unit to the first data is omitted, thereby furtherimproving data storage efficiency.

When the first data in the memory is lost, the first data lost from thememory can be recovered by using the first data in the secondnon-volatile storage unit. The log file of the first data in the secondnon-volatile storage unit can also be used to recover the first datalost from the memory. If a loss of the first data in the memory occursduring a process of converting the log file of the first data in thesecond non-volatile storage unit, the method may further include:determining whether a conversion from the log file of the first data tothe first data is completed; when the conversion is not completed,recovering the first data in the memory by using converted first dataand the log file of the first data that is not converted; and when theconversion is completed, recovering the first data in the memory byusing converted first data.

Optionally, when the second data in the memory is lost, the second datalost from the memory is recovered by using a log file of the second datain the first non-volatile storage unit.

Fast data read/write of the memory is achieved by using the foregoingmanner of recovering the data lost from the memory. When the data in thememory is lost, the lost data can be recovered in a timely manner,thereby ensuring service data security.

Refer to FIG. 13, which is a schematic flowchart of another dataprocessing method according to an embodiment of the present invention,where the data processing method is applied in a data processing deviceand includes:

Step 1300: Receive first data to be written into a memory of the dataprocessing device.

Step 1302: Write the first data into the memory, and write the firstdata into a first non-volatile storage unit in a log file form.

Step 1304: Write the first data in the memory into a second non-volatilestorage unit, where a data write speed of the first non-volatile storageunit is higher than a data write speed of the second non-volatilestorage unit.

The first data written into memory is written into the firstnon-volatile storage unit in the log file form, and the first data inthe memory is written into the second non-volatile storage unit. Becausethe data write speed of the first non-volatile storage unit is higherthan the data write speed of the second non-volatile storage unit, fastbackup of service data can be achieved, and especially for service datain the memory that needs to be stored by a storage processing device,the security of the memory data can be ensured. Meanwhile, the firstdata is stored in the log file form, and the log file has metadata andcan record only changed data and can implement data recovery; thereforewhen a capacity of the first non-volatile storage unit is smaller than acapacity of the memory, fast data backup can be achieved and data lostfrom the memory can be recovered when the data in the memory is lost.

Optionally, the method further includes: writing second data into thememory, and writing the second data into the first non-volatile storageunit in the log file form.

Optionally, when the first data in the memory is lost, the first data isrecovered by using the first data in the second non-volatile storageunit.

Optionally, the data write speed of the first non-volatile storage unitis the same as a data write speed of the memory.

Fast data read/write of the memory is achieved by using the foregoingmanner of recovering the data lost from the memory. When the data in thememory is lost, the lost data can be recovered in a timely manner,thereby ensuring service data security.

The following describes in detail the implementation manners of the dataprocessing device and the data processing method according to theembodiments of the present invention by using a server as an example.The data processing device may be a server, including a hardware device,such as a CPU, a memory, a system bus, a power supply, and software runin the hardware, such as an operating system. The operating system isdescribed by using a Linux operating system as an example. A blockdevice subsystem in the Linux operating system of the server isconnected to the memory of the server, and reads service data from thememory, or writes the service data into the memory.

Refer to FIG. 5, which is a schematic structural diagram of a specificapplication of a data processing device in a server according to anembodiment of the present invention. A memory read/write control unit105 in FIG. 5 is connected to the block device subsystem to performservice data read/write control, and store, in a memory 101, all servicedata that needs to be stored, where the memory 101 may be a DRAM.Meanwhile, the memory read/write control unit 105 stores, in a log areaof a first non-volatile storage unit 103 in a log file form, the datathat needs to be written into the memory 101. A persistency control unit106 reads the service data from the memory 101 and stores the servicedata in a log area of a second non-volatile storage unit 104, where thelog area of the second non-volatile storage unit 104 stores the servicedata in the log file form, and a data area stores an original format ofthe service data. Meanwhile, a data scrubbing unit 107 further scrubs,to the data area, the data in the log area of the second non-volatilestorage unit 104 or the data in the log area of the first non-volatilestorage unit 103, and deletes the log file in the corresponding log areato release space occupied by the log file. When the service data in thememory 101 is lost, a data recovery unit 108 reads the data in the dataarea of the persistency storage unit and recovers the data to the memory101, or recovers the data lost from the memory 101 by using the log filein the first non-volatile storage unit 103 or the second non-volatilestorage unit 104.

Table 1 describes model selection examples of high-speed storagemediums, namely, the first non-volatile storage unit 103 and the secondnon-volatile storage unit 104 (only a part of combinations are listed).

TABLE 1 Model Selection of the Model Selection of the First Non-volatileSecond Non-volatile Storage Unit 103 Storage Unit 104 Combination 1NVDIMM (Non-Volatile SSD (Solid State Disk, Dual In-line Memory solidstate disk) and HD Module, non-volatile dual (Hard Disk, hard disk)in-line memory module) and NVRAM (Non-Volatile Random Access Memory,non-volatile random access memory) Combination 2 SSD HD Combination 3High-speed HD Low-speed HD (low-cost combination) Combination 4 NVDIMM,NVRAM Remote storage Combination 5 Remote NVDIMM and Remote storageNVRAM

Refer to FIG. 6, which is a schematic flowchart of a data read/writeprocess performed by the memory read/write control unit 105 and thememory 101 in FIG. 5, including:

A specific process of data reading A1 is as follows:

A11: A Linux block device subsystem initiates a service data readrequest, where the read request carries an LBA (Logic Block Address,logic block address).

A12: The memory read/write control unit 105 calculates an offset ofrequested service data in the memory according to the LBA address in theread request.

As an optional implementation manner, the calculating an offset in thememory in this step may be implemented in the following manner:

If the memory continuously preempts and pre-applies for a segment of aphysical memory from DRAM_start to DRAM_start+DRAM_size, the calculationmethod is as follows:

DRAM_offset(LBA)=DRAM_start+LBA

If the memory is preempted by segment and occupation of N segments of aphysical memory are pre-applied for, a size of each segment of thephysical memory is DRAM_SEG_size, each segment of the physical memory iscontinuous itself, and segments may be discontinuous; all segment startaddresses are saved in an array DRAM_base[N]; and the calculation methodis as follows:

DRAM_offset(LBA)=DRAM_base[LBA/DRAM_SEG_size]+LBA% DRAM_S EG_size

A13: The memory read/write control unit 105 requests the service datafrom the memory 101 according to the memory offset.

That is, the memory read/write control unit 105 acquires the data fromthe memory 101 according to the memory offset and saves the data in acache pre-allocated by the block device subsystem.

A14: The memory read/write control unit 105 acquires the data in thememory.

A15: The memory read/write control unit 105 returns the read data to theblock device subsystem.

Because the memory 101 includes all service data that needs to be read,and compared with cache management such as a traditional cache query, inthe manner of acquiring the memory offset in step A12, a time overheadand a space overhead are very small, the foregoing service data readprocess improves the service data read efficiency.

A specific process of data reading A2 in FIG. 5 is as follows:

A21: The block device subsystem initiates a service data write request,where the write request carries an LBA address.

A22: The memory read/write control unit 105 calculates, according to theLBA address in the request, the offset of the requested service data inthe memory.

An implementation manner of calculating the offset in the memory in thisstep is similar to that in step A12, which is not further describedherein.

A23: The memory read/write control unit 105 writes the service data intothe memory 101 according to the memory offset acquired after thecalculation.

A24: The memory 101 returns a write success to the memory read/writecontrol unit 105.

A25: The memory read/write control unit 105 converts the service datawritten into the memory 101 to log data and writes the converted logdata into log space of the first non-volatile storage unit 103 in acontinuous writing manner.

The log space of the first non-volatile storage unit 103 may adopt acycle use mode. After the persistency control unit 106 stores the logfile of the service data in the second non-volatile storage unit 104,space occupied by the log file of the corresponding service data in thefirst non-volatile storage unit 103 is released, and released spacebecomes new available log space. As described in Table 2, space betweenloc 1 and loc 2 is unavailable, and the space, before loc 1, occupied bythe log data on which the persistency control unit 106 has performedpersistency is released.

TABLE 2

A26: The first non-volatile storage unit 103 returns the write successto the memory read/write control unit 105.

A27: The memory read/write control unit 105 returns the write success tothe block device subsystem.

A specific implementation manner of writing the service data into thememory 101 (DRAM) in a random writing manner and converting the data tothe log file and writing the log file into the first non-volatilestorage unit 103 in a continuous writing manner in the embodiment of thepresent invention is described by using written service data

9 2 8 3 2 1 a b c d e fas an example. Refer to FIG. 7, which is a schematic diagram of aspecific implementation manner of writing the service data into thememory 101 and the first non-volatile storage unit 103. In FIG. 7,writing into the memory 101 uses the random writing manner, that is,step A22 may use the random writing manner; when the data is writteninto the first non-volatile storage unit 103, the continuous writingmanner is used, that is, the log file “9a2b8c3d2elf” is written into thelog area of the first non-volatile storage unit 103 in step A25.

In the foregoing process of writing the service data, because the memoryincludes all service data that needs to be stored, in a write processingprocess, a time overhead and a space overhead for cache management suchas a traditional cache query and a cache update do not exist, therebyimproving the service data storage efficiency. A completely continuouswriting manner can improve the efficiency of writing the log file of theservice data into the first non-volatile storage unit 103. Thecompletely continuous writing manner indicates that the data iscontinuously written into the first non-volatile storage unit 103 andthe data in the first non-volatile storage unit 103 is not read duringthe data writing process.

FIG. 8-a is a schematic flowchart of acquiring a log file of first datafrom a first non-volatile storage unit and performing data persistencyin FIG. 5; as shown in FIG. 8-a, a process of acquiring the log filefrom the first non-volatile storage unit 103 by the second non-volatilestorage unit 104 is as follows:

B20′: The persistency control unit 106 requests, from the firstnon-volatile storage unit 103, the log file of the service data to bepersisted.

B21′: The persistency control unit 106 writes, into the log area of thesecond non-volatile storage unit 104, the log file to be persisted inthe first non-volatile storage unit 103.

B22′: After the writing is successful, the persistency storage unitreturns a write success message to the persistency control unit 106.

B31′: The persistency control unit 106 instructs the memory read/writecontrol unit 105 to release log space occupied by the corresponding logfile in the first non-volatile storage unit 103.

B32′: The first non-volatile storage unit 103 returns a release successmessage to the persistency control unit 106.

FIG. 8-b is a schematic flowchart of acquiring first data from a memoryand performing data persistency in FIG. 5; as shown in FIG. 8-b, aprocess of acquiring the log file from the memory 101 by the secondnon-volatile storage unit 104 is as follows:

B11: The memory read/write control unit 105 notifies the persistencycontrol unit 106 of that new service data requires persistent storage,where an instruction carries an LBA address and a size Size of the data.

B12: The persistency control unit 106 calculates an offset of theservice data, which requires persistent storage, in the memory.

B13: The persistency control unit 106 reads, from the memory 101according to the memory offset, the data that requires persistency.

B14: The persistency control unit 106 successfully reads the servicedata that requires persistency.

B21: The persistency control unit 106 converts, to a log format, theservice data to be persisted and writes the service data into the logarea of the second non-volatile storage unit 104; optionally, thepersistency control unit 106 may further directly write, into the dataarea of the second non-volatile storage unit 104, the service data to bepersisted.

A manner for writing the service data into the log area of the secondnon-volatile storage unit 104 in this step is similar to that in stepA25, which is not further described herein.

B22: After the writing is successful, the persistency storage unitreturns a write success message to the persistency control unit 106.

B31: The persistency control unit 106 instructs the memory read/writecontrol unit 105 to release the log space, in the first non-volatilestorage unit 103, occupied by the service data written in step B21.

B32: The first non-volatile storage unit 103 returns the release successmessage to the persistency control unit 106.

In the foregoing service data persistency process, in step B13, thepersistency control unit 106 directly reads the service data from thememory 101 without reading the service data from the first non-volatilestorage unit 103, thereby achieving separation of reading and writing,easing pressure of the first non-volatile storage unit 103, andimproving the efficiency of storing the service data in the memory bythe first non-volatile storage unit 103.

Refer to FIG. 9, which is a schematic flowchart of writing the servicedata in the memory 101 into the data area of the second non-volatilestorage unit 104 by the data scrubbing unit 107 in FIG. 5, including:

C11: The persistency control unit 106 notifies the data scrubbing unit107 of that new service data needs to be scrubbed, that is, the newservice data needs to be written into the data area of the secondnon-volatile storage unit 104, where the instruction carries the LBAaddress and a size of the service data to be scrubbed in the memory.

C12: The data scrubbing unit 107 calculates the offset of the servicedata to be scrubbed in the memory according to the LBA address.

A manner of calculating the memory offset in this step is similar tothat in step A12, which is not further described herein.

C13: The data scrubbing unit 107 reads, from the memory 101 according tothe calculated memory offset, the data that needs to be written into thedata area of the persistency storage unit.

C14: The memory 101 returns a service data reading success message.

C21: The data scrubbing unit 107 writes, into the data area of thesecond non-volatile storage unit 104, the data to be scrubbed.

C22: The second non-volatile storage unit 104 returns writing successmessage to the data scrubbing unit 107.

C31: The data scrubbing unit 107 instructs the persistency control unit106 to delete the log file, in the first non-volatile storage unit 103,of the service data that has been written into the data area of thesecond non-volatile storage unit 104, to release the space occupied bythe service data in the first non-volatile storage unit 103.

C32: The persistency control unit 106 returns a release success messageto the data scrubbing unit 107.

In the foregoing implementation method, in step C13, the data scrubbingunit 107 directly reads the service data from the memory 101, therebyeasing pressure of the second non-volatile storage unit 104, achievingseparation of reading and writing, and improving the efficiency ofwriting the log file by the second non-volatile storage unit 104.

The foregoing step C21 may also store, to the data space of the secondnon-volatile storage unit 104 from the log space of the secondnon-volatile storage unit 104, the service data to be scrubbed;accordingly, the data scrubbing unit 107 instructs the persistencycontrol unit 106 to delete the log file, in the log area, of the servicedata that has been written into the second non-volatile storage unit104, to release the log space occupied by the service data in the secondnon-volatile storage unit 104.

The service data written into the memory 101 is stored in the log areaof the first non-volatile storage unit 103 and the log area of thesecond non-volatile storage unit 104 in the log file form, so that thedata lost from the memory 101 can be recovered by using these log fileswhen the service data in the memory 101 (DRAM) is lost due to a restartcaused by a failure, for example, the data processing device 100 ispowered off. As an optional manner, the data scrubbing unit 107 mayconvert the log file that has not been written into the log area of thesecond non-volatile storage unit 104 to the service data first andstores the service data in the data area; if the service data that hasnot been written into the log area of the second non-volatile storageunit 104 also exists before the data processing device 100 is restarted,because a data storage speed of the first non-volatile storage unit 103is higher than a data storage speed of the second non-volatile storageunit 104, the data scrubbing unit 107 acquires the log file from the logarea of the first non-volatile storage unit 103, converts the log fileto the service data, and writes the converted service data into the dataarea of the second non-volatile storage unit 104.

Refer to FIG. 10, which is a schematic flowchart of a data recoveryprocess performed by the data recovery unit 108 in FIG. 5.

In an initialization phase of the data processing device 100, the datarecovery unit 108 invokes a sub-data scrubbing unit 107 to perform datascrubbing (step D111 and step D112, to scrub the data that has not beenscrubbed before an abnormal power failure or normal powering off. A datarecovery process is as follows:

D211: The data recovery unit 108 reads metadata information in the dataarea of the second non-volatile storage unit 104 and determines a startposition and a size of the data to be recovered.

D212: The data recovery unit 108 reads the service data in sequence.

D213: The second non-volatile storage unit 104 returns a read successmessage.

D221: The data recovery unit 108 writes the read service data into thememory 101 in sequence.

D222: The memory 101 returns a service data write success message to thedata recovery unit 108.

The read and write manners in the foregoing sequence can reach a maximumbandwidth throughput and further improve data read and write speed andefficiency.

As an optional implementation manner, the foregoing data scrubbing andrecovery may be concurrently performed, that is, step D111 and step D221 may be performed at the same time. If the data in the memory 101 islost during a data scrubbing process, the data lost from the memory 101is recovered by using the log files of the data that has been scrubbedand has not been scrubbed. If the data in the memory 101 is lost afterthe data in the memory 101 is written into the first non-volatilestorage unit 103 but before the log file is written into the secondnon-volatile storage unit 104, the data lost from the memory 101 isrecovered by using the log file in the first non-volatile storage unit103.

The implementation manner shown in FIG. 5 is a technical solutionimplemented on the server side. As an optional implementation manner,the data processing device and method in the embodiments of the presentinvention may further be implemented on a storage side and in a hardwarecard. Implementing the foregoing data processing device and method onthe storage side can achieve a fact that all service data that needs tobe stored is stored in the memory shared by remote ends. For theimplementation in the hardware card, the hardware card that provides afunction of the data processing device in the embodiment of the presentinvention and can implement the data processing method in the embodimentof the present invention can be connected to a server forimplementation.

A person of ordinary skill in the art may be aware that, with referenceto the examples described in the embodiments disclosed in thisspecification, units and algorithm steps may be implemented byelectronic hardware, computer software, or a combination thereof. Toclearly describe the interchangeability between the hardware and thesoftware, the foregoing has generally described compositions and stepsof each example according to functions. Whether the functions areperformed by hardware or software depends on particular applications anddesign constraint conditions of the technical solutions. A personskilled in the art may use different methods to implement the describedfunctions for each particular application, but it should not beconsidered that the implementation goes beyond the scope of the presentinvention.

It may be clearly understood by a person skilled in the art that, forthe purpose of convenient and brief description, for a detailed workingprocess of the foregoing system, apparatus, and unit, reference may bemade to a corresponding process in the foregoing method embodiments, anddetails are not described herein again.

In the several embodiments provided in the present application, itshould be understood that the disclosed system, apparatus, and methodmay be implemented in other manners. For example, the describedapparatus embodiment is merely exemplary. For example, the unit divisionis merely logical function division and may be other division in actualimplementation. For example, a plurality of units or components may becombined or integrated into another system, or some features may beignored or not performed. In addition, the displayed or discussed mutualcouplings or direct couplings or communication connections may beimplemented through some interfaces. The indirect couplings orcommunication connections between the apparatuses or units may beimplemented in electronic, mechanical, or other forms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,that is, may be located in one position, or may be distributed on aplurality of network units. A part or all of the units may be selectedaccording to actual needs to achieve the objectives of the solutions ofthe embodiments of the present invention.

In addition, functional units in the embodiments of the presentinvention may be integrated into one processing unit, or each of theunits may exist alone physically, or two or more units are integratedinto one unit. The integrated unit may be implemented in a form ofhardware, or may be implemented in a form of a software functional unit.

When the integrated unit is implemented in the form of a softwarefunctional unit and sold or used as an independent product, theintegrated unit may be stored in a computer-readable storage medium.Based on such an understanding, the technical solutions of the presentinvention essentially, or the part contributing to the prior art, or allor a part of the technical solutions may be implemented in the form of asoftware product. The software product is stored in a storage medium andincludes several instructions for instructing a computer device (whichmay be a personal computer, a server, or a network device, or the like)to perform all or a part of the steps of the methods described in theembodiments of the present invention. The foregoing storage mediumincludes: any medium that can store program code, such as a USB flashdrive, a removable hard disk, a read-only memory (ROM, Read-OnlyMemory), a random access memory (RAM, Random Access Memory), a magneticdisk, or an optical disc.

The foregoing descriptions are merely specific embodiments of thepresent invention, but are not intended to limit the protection scope ofthe present invention. Any modification or replacement readily figuredout by a person skilled in the art within the technical scope disclosedin the present invention shall fall within the protection scope of thepresent invention. Therefore, the protection scope of the presentinvention shall be subject to the protection scope of the claims.

What is claimed is:
 1. A data processing device, comprising: a controlunit; a memory coupled to the control unit; a first non-volatile storageunit coupled to the control unit; and a second non-volatile storage unitcoupled to the first non-volatile storage unit, wherein a data writespeed of the first non-volatile storage unit is higher than a data writespeed of the second non-volatile storage unit, wherein the control unitis configured to write first data into the memory, and write log file ofthe first data into the first non-volatile storage unit, and wherein thelog file of the first data records data changes of the first data, andwrite, into the second non-volatile storage unit, the log file of thefirst data written into the first non-volatile storage unit.
 2. The dataprocessing device according to claim 1, wherein the control unitcomprises a memory read/write control unit and a persistency controlunit, wherein the memory read/write control unit is configured to writethe first data into the memory, and write the log file of the first datainto the first non-volatile storage unit; and the persistency controlunit is configured to write, into the second non-volatile storage unit,the log file of the first data written into the first non-volatilestorage unit.
 3. The data processing device according to claim 2,wherein the memory read/write control unit is further configured towrite second data into the memory, and write a log file of the seconddata into the first non-volatile storage unit.
 4. The data processingdevice according to claim 3, wherein the data recovery unit is furtherconfigured to recover the first data lost in the memory by using the logfile of the first data in the second non-volatile storage unit, andrecover the second data lost in the memory by using the log file of thesecond data in the first non-volatile storage unit.
 5. The dataprocessing device according to claim 2, wherein the persistency controlunit is further configured to, after the log file of the first data inthe first non-volatile storage unit is written into the secondnon-volatile storage unit, instruct the first non-volatile storage unitto release space occupied by the log file of the first data.
 6. The dataprocessing device according to claim 3, wherein the persistency controlunit is further configured to, when the memory read/write control unitwrites the log file of the second data into the first non-volatilestorage unit , suspend writing the log file of the first data in thefirst non-volatile storage unit into the second non-volatile storageunit.
 7. The data processing device according to claim 1, wherein thedata write speed of the first non-volatile storage unit is the same as adata write speed of the memory.
 8. A data processing device, comprising:a control unit; a memory coupled to the control unit; a firstnon-volatile storage unit coupled to the control unit; and a secondnon-volatile storage unit coupled to the first non-volatile storageunit, wherein a data write speed of the first non-volatile storage unitis higher than a data write speed of the second non-volatile storageunit, wherein the control unit is configured to write first data intothe memory, and write a log file of the first data into the firstnon-volatile storage unit , and wherein the control unit is furtherconfigured to acquire the first data from the memory, and convert theacquired first data to the log file and write the converted log fileinto the second non-volatile storage unit, or acquire the first datafrom the memory and write the first data into the second non-volatilestorage unit, wherein the log file of the first data records datachanges of the first data.
 9. The data processing device according toclaim 8, wherein the control unit comprises a memory read/write controlunit and a persistency control unit, wherein the memory read/writecontrol unit is configured to write the first data into the memory, andwrite the log file of the first data into the first non-volatile storageunit; and the persistency control unit is configured to acquire thefirst data from the memory, and convert the acquired first data to thelog file and write the converted log file into the second non-volatilestorage unit, or acquire the first data from the memory and write thefirst data into the second non-volatile storage unit.
 10. The dataprocessing device according to claim 8, wherein the memory read/writecontrol unit is further configured to write second data into the memory,and write a log file of the second data into the first non-volatilestorage unit.
 11. The data processing device according to claim 10,wherein the data recovery unit is further configured to recover thefirst data lost in the memory by using the log file of the first data inthe second non-volatile storage unit, and recover the second data lostin the memory by using the log file of the second data in the firstnon-volatile storage unit.
 12. A data processing method applied in adata processing device, comprising: receiving, by the data processingdevice, first data to be written into a memory of the data processingdevice; writing the first data into the memory, and writing a log fileof the first data into a first non-volatile storage unit , wherein thelog file of the first data records data changes of the first data; andwriting, into a second non-volatile storage unit, the log file of thefirst data written into the first non-volatile storage unit, wherein adata write speed of the first non-volatile storage unit is higher than adata write speed of the second non-volatile storage unit.
 13. The dataprocessing method according to claim 12, further comprising: writingsecond data into the memory, and writing a log file of the second datainto the first non-volatile storage unit.
 14. The data processing methodaccording to claim 13, further comprising: when the first data in thememory is lost, recovering the first data lost in the memory by usingthe log file of the first data in the second non-volatile storage unit;and when the second data in the memory is lost, recovering the seconddata lost in the memory by using the log file of the second data in thefirst non-volatile storage unit.
 15. The data processing methodaccording to claim 12, wherein after the writing, into a secondnon-volatile storage unit, the log file of the first data in the firstnon-volatile storage unit, instructing the first non-volatile storageunit to release space occupied by the log file of the first data. 16.The data processing method according to claim 13, wherein when thesecond data is written into the first non-volatile storage unit in thelog file form, suspending writing the log file of the first data in thefirst non-volatile storage unit into the second non-volatile storageunit.
 17. A data processing method applied in a data processing device,comprising: receiving, by the data processing device, first data to bewritten into a memory of the data processing device; writing the firstdata into the memory, and writing a log file of the first data into afirst non-volatile storage unit ; and converting the first data in thememory to the log file and writing the converted log file into a secondnon-volatile storage unit, writing the first data in the memory into asecond non-volatile storage unit, wherein a data write speed of thefirst non-volatile storage unit is higher than a data write speed of thesecond non-volatile storage unit, and wherein the log file of the firstdata records data changes of the first data.
 18. The data processingmethod according to claim 17, further comprising: writing second datainto the memory, and writing a log file the second data into the firstnon-volatile storage unit .
 19. The data processing method according toclaim 18, further comprising: when the first data in the memory is lost,recovering the first data lost in the memory by using the log file ofthe first data in the second non-volatile storage unit; and when thesecond data in the memory is lost, recovering the second data lost inthe memory by using the log file of the second data in the firstnon-volatile storage unit.
 20. The data processing method according toclaim 17, wherein the recovering the first data lost in the memory byusing the first data in the second non-volatile storage unit comprises:determining whether a conversion from the log file of the first data tothe first data is completed; when the conversion is not completed,recovering the first data in the memory by using converted first dataand the log file of the first data that is not converted; and when theconversion is completed, recovering the first data in the memory byusing converted first data.